from agents import function_tool, Agent, Runner

import study.Openai_Config as config

config.set_client()


@function_tool
def get_weather(city: str):
    print(f"getting weather for {city}")
    return f"The weather in {city} is 雨天."


agent = Agent(
    name="天气助手",
    instructions="""
    你是一个天气预报员，根据输入，能相信查询出天气，并且能给出出行建议以及穿衣建议。
    
    输出格式为json
    """,
    tools=[get_weather],
)


def test():
    #
    result = Runner.run_sync(agent, "安阳的天气")
    print(result.final_output)
